import React from 'react';
import {Icon, NavBar} from "antd-mobile";
import {Sticky} from 'react-sticky';

// 参考 https://react-sticky.netlify.app/#/stacked

class StickyNav extends React.Component {
  render() {
    const {title = "", ...otherParam} = this.props;
    return (
      <Sticky>
        {({style: styleParam}) => (
          <div style={{...styleParam,zIndex:500}}>
            <NavBar
              {...otherParam}
            >{title}</NavBar>
          </div>
        )}
      </Sticky>
    );
  }
}

export default StickyNav;
